package com.bohua.intermediary.controller;

import com.bohua.intermediary.common.Lay;
import com.bohua.intermediary.common.Msg;
import com.bohua.intermediary.entity.SysTrip;
import com.bohua.intermediary.security.MyUser;
import com.bohua.intermediary.service.SysTripService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
/**
 * 控制器
 * @author qian
 * @email 1415261159@qq.com
 * @date 2019/01/19
 */
@Controller
@RequestMapping("/sysTrip")
public class SysTripController {
    @Resource
    private SysTripService sysTripService;


    @RequestMapping
    public String sysTrip(){


        return "sysTrip/sysTrip";
    }
    @RequestMapping("/add")
    public String add(){
        return "sysTrip/addSysTrip";
    }

    @RequestMapping("/update")
    public String update(){
        return "sysTrip/updateSysTrip";
    }

    @RequestMapping("/getSysTrips")
    @ResponseBody
    public Lay getSysTrips(SysTrip sysTrip,Integer page,Integer limit){
        return sysTripService.getSysTrips(sysTrip,page,limit);
    }
    @RequestMapping("/addSysTrip")
    @ResponseBody
    public Msg addSysTrip(SysTrip sysTrip){
        return sysTripService.addSysTrip(sysTrip);
    }

    @RequestMapping("/updateSysTrip")
    @ResponseBody
    public Msg updateSysTrip(SysTrip sysTrip){
        return sysTripService.updateSysTrip(sysTrip);
    }

    @RequestMapping("/delSysTrip")
    @ResponseBody
    public Msg delSysTrip(SysTrip sysTrip){
        return sysTripService.delSysTrip(sysTrip);
    }
}
